package com.acme;

import java.util.Arrays;

class Testing {
	public static final String[] operands = {"+", "-", "x", "/"};
	
	private static boolean isStringDouble (String str) {
		try {
			Double.parseDouble(str);
			return true;
		}catch (NumberFormatException e){
			return false;
		}	
	}
	
	public static boolean isDataOk (String[] str) {
		if (str.length != 3) return false;
		if (!(isStringDouble(str[0]) && isStringDouble(str[2]))) 
			return false;
		if (!Arrays.asList(operands).contains(str[1]))
			return false;
		return true;
	}	
	
}

/**
 * @author Alexander Bulakh
 *
 */
public class TaskCalculator {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		if (Testing.isDataOk (args)) {
			
			double num1 = Double.parseDouble(args[0]);
			double num2 = Double.parseDouble(args[2]);
			
			switch (args[1]) {
			case "+": 
				System.out.println(num1+num2);
				break;
			case "-": 
				System.out.println(num1-num2);
				break;
			case "x":
				System.out.println(num1*num2);
				break;
			case "/":
				System.out.println(num1/num2);
				break;
			}
		}
		else 
			System.out.println("Wrong input data");			
	}

}
